package com.hejing.反射的理解与使用;

/**
 * ClassName: Person
 * Package: com.hejing.反射的理解与使用.txt
 * Description:
 *
 * @Author: HeJing
 * @Create: 2023-06-03 16:03
 * @Version: 1.0
 */
public class Person {
    // 属性:
    private String name;
    public int age;

    public Person() {
        System.out.println("Person()...");
    }

    public Person(int age) {
        this.age = age;
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    // 方法:
    public void show() {
        System.out.println("你好，我是一个Person...");
    }

    private String showNation(String nation) {
        return "我的国籍是: " + nation;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}































